﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html class="x-admin-sm">
<head>
    <meta name="viewport" content="width=device-width" />
    <meta charset="UTF-8">
    <title>系统参数添加</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link href="~/Content/X-admin/css/font.css" rel="stylesheet" />
    <script src="~/Content/X-admin/lib/layui/layui.js"></script>
    <link href="~/Content/X-admin/css/xadmin.css" rel="stylesheet" />
    <script src="~/Content/X-admin/js/jquery.min.js"></script>
    <script src="~/Content/X-admin/js/xadmin.js"></script>
    <script src="~/Content/Scripts/System/systemFrame.js"></script>
    <script src="~/Content/select2/select2.min.js"></script>
    <link href="~/Content/select2/select2.min.css" rel="stylesheet" />
    <script src="~/Content/Scripts/System/Common.js"></script>

</head>
<body>
    <span style="margin-top:15px;margin-left:15px">
        <xblock>
            <button class="layui-btn layui-btn-normal" onclick="saveData()"><i class="layui-icon"></i>保存</button>
            <button class="layui-btn layui-btn-normal" onclick="closeWin()"><i class="layui-icon"></i>取消</button>
        </xblock>
    </span>

    <div style="margin: 20px; border: 1px solid #dbdbdb;padding:15px">

        <form id="AddForm">

            <div class="layui-form-item">
                <label for="L_email" class="layui-form-label">
             存货编码
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="proCode" name="proCode" required="" autocomplete="off" class="layui-input" onclick="openProduct()">

                </div>

                <label for="L_email" class="layui-form-label">
                    存货名称
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="proName" name="proName" required="" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label for="L_email" class="layui-form-label">
                  打印分数
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="proCode" name="proCode" required="" autocomplete="off" class="layui-input">
                </div>
                <label for="L_email" class="layui-form-label">
                 条码类型
                </label>
                <div class="layui-input-inline">
                    <select name="types" id="types" class="valids" style="width:120px;height:33px">
                        <option value="">请选择</option>
                    </select>

                </div>
            </div>
            <div class="layui-form-item">
                <label for="L_email" class="layui-form-label">
                    期初标识
                </label>
                <div class="layui-input-inline" style="margin-top:10px">
                    <input name="isInitial" id="isInitial" lay-skin="primary" type="checkbox" value="2" style="margin-right:5px">是 

                </div>
              
                </div>
</form>

    </div>
</body>
</html>
<script type="text/javascript">
    $(function () {
        var dataId = getUrlVariable("planCode");
         DictionaryDropDown("bat", "valids", "");

    });

    // 保存数据
    function saveData() {
        $.ajax({
            url: "../Bar/SaveBarCode",
            data: { datas: JSON.stringify(FormToJson("AddForm")) },
            dataType: "json",
            type: "POST",
            success: function (data) {
                if (data.Result) {
                    var msg = "信息添加成功";
                    layer.alert(msg, { icon: 6 }, function () {
                        // 获得frame索引
                        var index = parent.layer.getFrameIndex(window.name);
                        //关闭当前frame
                        parent.layer.close(index);
                    });
                } else {
                    layer.msg(data.Message);
                }
            }
        });
    }

    function openProduct() {
        InfoOpenPage("../Common/selectCompleteProduct?field=proCode-proName", "存货选择", "95%", "90%");
    }
</script>